<!DOCTYPE HTML>
<html lang="en">
<head>
<title>FileCreateDir - Syntax &amp; Usage | AutoHotkey</title>
<meta name="description" content="The FileCreateDir command creates a folder." />
<meta name="ahk:equiv-v2" content="commands/DirCreate.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>FileCreateDir</h1>

<p>Creates a folder.</p>

<pre class="Syntax"><span class="func">FileCreateDir</span>, DirName</pre>
<h2>Parameters</h2>
<dl>

  <dt>DirName</dt>
  <dd><p>Name of the directory to create, which is assumed to be in <a href="../Variables.htm#WorkingDir">%A_WorkingDir%</a> if an absolute path isn't specified.</p></dd>

</dl>
<h2>Error Handling</h2>
<p><span class="ver">[v1.1.04+]</span>: This command is able to throw an exception on failure. For more information, see <a href="Catch.htm#RuntimeErrors">Runtime Errors</a>.</p>
<p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is set to 1 if there was a problem or 0 otherwise.</p>
<p><a href="../Variables.htm#LastError">A_LastError</a> is set to the result of the operating system's GetLastError() function.</p>
<h2>Remarks</h2>
This command will also create all parent directories given in <em>DirName</em> if they do not already exist.
<h2>Related</h2>
<p><a href="FileRemoveDir.htm">FileRemoveDir</a></p>
<h2>Examples</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>FileCreateDir, C:\Test1\My Images\Folder2</pre>
</div>

</body>
</html>
